package com.github.data_manage.controller

import com.github.data_manage.common.CommonResult
import com.github.data_manage.dao.MenuDao
import com.github.data_manage.domain.po.Menu
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.tags.Tag
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 *@author CHN
 *@since 2024-08-18 16:50
 */
@RestController
@RequestMapping("/menu")
@Tag(name = "MenuController", description = "菜单管理")
class MenuController(private val menuDao: MenuDao) {

    @GetMapping("/list")
    @Operation(description = "查询所有菜单")
    fun getAllMenus(): CommonResult<List<Menu>> {
        return CommonResult.success(menuDao.findAll())
    }

}